<%--
  Created by IntelliJ IDEA.
  User: chengweixin
  Date: 2018/3/23
  Time: 下午1:51
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>jsonp</title>


    <script src="http://www.w3school.com.cn/jquery/jquery-1.11.1.min.js"></script>

    <script type="application/javascript">


        $(document).ready(function () {

            var url = "http://www.coolneng.com/wap/json/link.php";

//            url = "http://localhost:8080/testaja";

//
//            $.ajax({
//                type: "post",
//                url: url,
////                data: "para=" + para, 此处data可以为 a = 1 & b = 2类型的字符串 或 json数据。
//                data: {
//                    "source": 1
//                }
//                ,
//                dataType: "json",
//                success: function (data, textStatus, jqXHR) {
//                    console.log(data);
//                    alert("abcd");
//                }
//                ,
//                error: function (XMLHttpRequest, textStatus, errorThrown) {
//                    alert("请求失败！");
//                }
//            });

            alert("1111");
            $.post(url,
                {
                    name: "Donald Duck",
                    city: "Duckburg"
                },
                function (data, status) {
                    alert("abc");
                    console.log("Data: " + data + "\nStatus: " + status);

                    $("#content").text(data);
                });

            alert("2222");

        });


    </script>
</head>
<body>


<div id="content">

</div>

</body>
</html>
